/*
 * OrderResultStatisticsHolder.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.viewholder;

import android.view.View;
import android.widget.TextView;

import com.yidiandao.business.R;
import com.yidiandao.business.data.response.QueryOrderResultResponse;
import com.yidiandao.business.ui.widget.listview.ViewHolder;
import com.yidiandao.business.utils.UIUtils;

/** 订单结果-统计ViewHolder(付款金额，付款方式，收货人，收货地址) */
public class OrderInformationResultStatisticsHolder extends ViewHolder {

    private TextView mTvOrderPrice;
    private TextView mTvOrderPayWay;
    private TextView mTvOrderConsignee;
    private TextView mTvAddressHint;
    private TextView mTvOrderAddress;

    @Override
    protected void initView(View rootView) {
        mTvOrderPrice = (TextView) rootView.findViewById(R.id.tv_order_value);
        mTvOrderPayWay = (TextView) rootView.findViewById(R.id.tv_order_pay_way);
        mTvOrderConsignee = (TextView) rootView.findViewById(R.id.tv_order_consignee);
        mTvAddressHint = (TextView) rootView.findViewById(R.id.tv_address_hint);
        mTvOrderAddress = (TextView) rootView.findViewById(R.id.tv_order_address);
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_order_information_result_statistics;
    }

    public void refreshUI(QueryOrderResultResponse.Data data) {
        mTvOrderPrice.setText(UIUtils.getString(R.string.shopping_cart_value, data.getPayAmount()));
        mTvOrderPayWay.setText(data.getPayName());
        mTvOrderConsignee.setText(data.getConsignee());
        mTvOrderAddress.setText(data.getAddress());
    }
}
